import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { getLanguage,getEnUsLanguage } from "./util/request";
import { createI18n } from 'vue-i18n'		//引入vue-i18n组件


//注册i8n实例并引入语言文件
const i18n = createI18n({
  locale: 'zh-CN'
})


createApp(App)
  .use(router)
  .use(i18n)
  .mount('#app')

getLanguage({}).then((res) => {
  i18n.global.setLocaleMessage('zh-CN',Object.assign(res));
});
getEnUsLanguage({}).then((res) => {
  i18n.global.setLocaleMessage('en-US',Object.assign(res));
});